#include "ixemelle.h"
# include <stdlib.h>   /* malloc */
# include <string.h>   /* memcpy */
# include <stdio.h>    /* printf */


static void xml_copy_value ( const void * value , void ** pt ) {
	* pt = NULL ;
	* pt = (void *) malloc ( NAME_MAX_LENGTH * sizeof ( char ) ) ;
	memcpy ( * pt , value , NAME_MAX_LENGTH * sizeof ( char ) );
}

static void xml_copy_element ( const void * value , void ** pt ) {
	* pt = malloc ( sizeof ( attribute ) ) ;
	memcpy ( * pt , value , sizeof ( attribute ) );
}


static void xml_free_value ( void ** pt ) {
	free ( * pt ) ;
	* pt = NULL ;
}

static void xml_free_element ( void ** pt ) {
	free ( * pt ) ;
	* pt = NULL ;
}

void ixemelle_create ( list_forest * al_py ){
	list_forest_create(al_py,& xml_copy_value,& xml_free_value,& xml_copy_element,& xml_free_element);
}